package com.xujp.pagment18001.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xujp.common.entity.Payment;
import com.xujp.pagment18001.dao.PaymentDao;
import com.xujp.pagment18001.service.PaymentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author xujp
 * @date 2021/04/29/0029 16:56
 * @description:
 */
@Service
@Slf4j
public class PaymentServiceImpl implements PaymentService {
    @Autowired
    private PaymentDao paymentDao;

    @Override
    public int insert(Payment payment) {

        int insert = paymentDao.insert(payment);
        return insert;
    }

    @Override
    public List<Payment> query() {

        QueryWrapper<Payment> query = new QueryWrapper<>();
        List<Payment> payments = paymentDao.selectList(query);

        return payments;
    }

}
